<template>
  <div class="achievement-box">
    <!-- <Pie id="pie" :data="featuresInfo" :j="j"/> -->
    <PanelB ref="panelB" :achievementId="achievementId"/>
  </div>
</template>

<script>
import Pie from './child/Pie'
import PanelB from './child/PanelB'
let jwt = require("jsonwebtoken")
export default {
  props: {
    achievementId: {
      type: String
    },
    publicInfo: {
      type: Object
    },
  },
  components: {
    Pie,
    PanelB
  },
  data() {
    return {
      keyword: '',
      user: '',
      featuresInfo: {},
      j: '',
    }
  },
  methods: {
    init() {
      this.getPatentFeatures()
    },
    // 获取专利估值
    getPatentFeatures() {
      this.$refs.panelB.init(this.publicInfo.pn)
      // 暂时不需要，注释掉了
      // this.$get(this.$Url.patentAssess.getPatentFeatures, {
      //   pn: this.publicInfo.pn,
      //   user: this.user,
      // }).then(res => {
      //   if (res.status === 200) {
      //     this.featuresInfo = res.data
      //   }
      // }).catch(err => {})
      // this.$get(this.$Url.patentAssess.patentDetailByPn, {
      //   pn: this.publicInfo.pn,
      // }).then(res => {
      //   let data = res.data
      //   this.j = data.j || '0'
      // }).catch(err => {})
    }
  },
  created() {
    let token = this.$cookie.get("token");
    if (token && token !== "") {
      this.user = jwt.decode(token).sub;
    }
  },
  mounted() {
    this.init()
  }
}
</script>

<style lang="scss" scoped>
.achievement-box {
  position: relative;
  display: flex;
  width: 100%;
  height: 100%;
  overflow-y: auto;
}
</style>